package com.ny.shiyan.shiyan4;

public class AlipayPayment implements Payment {
    private double balance = 500.0;

    @Override
    public boolean pay(double amount) {
        if (amount <= balance) {
            balance -= amount;
            System.out.println("支付宝支付成功! 支付金额: ¥" + amount);
            System.out.println("支付宝余额: ¥" + balance);
            return true;
        } else {
            System.out.println("支付宝支付失败! 余额不足");
            return false;
        }
    }
}
